## Reading layer `SVI2018_NORTHCAROLINA_tract' from data source `S:\team\System Analytics\Walker\ID4029_Heath_Equity_Analysis\analysis\20200622_BuildSVI_BlockGroup\data-raw\NorthCarolina\SVI2018_NORTHCAROLINA_tract.shp' using driver `ESRI Shapefile'
## Simple feature collection with 2192 features and 126 fields
## geometry type: MULTIPOLYGON
## dimension: XY
## bbox: xmin: -84.32187 ymin: 33.84232 xmax: -75.46062 ymax: 36.58812
## epsg (SRID): 4269
## proj4string: +proj=longlat +datum=NAD83 +no_defs
counties <- c("Guilford" ) #"Randolph", "Rockingham", "Alamance", "Forsyth",
CONE_serv <- SVI_orig %>%
filter(COUNTY %in% counties,
!E_TOTPOP == 0)SVI <-
CombinedSVI %>%
mutate(GEOID = as.character(glue::glue("{state}{county}{tract}{block_group}"))) %>%
rowwise() %>%
mutate(TotalPercentile = sum(c_across(cols = starts_with("Pctl_")))) %>%
ungroup() %>%
mutate(PCT = ntile(TotalPercentile, 100)/100)
SVI %>%
ggplot(aes(TotalPercentile))+
geom_histogram(bins=10, fill='#69b3a2', color='white') +
# scale_x_continuous(labels = scales::percent_format())+
labs(title = "Distribution of Summed Percentile Scores",
x = "Summed Percentile Scores")## Warning: Removed 2 rows containing non-finite values (stat_bin).
## Warning: `group_by_()` is deprecated as of dplyr 0.7.0.
## Please use `group_by()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
SVI_sf <- st_as_sf(SVI_sf)
mapview::mapview(SVI_sf, zcol = "PCT", layer.name = c("PCT")) +
mapview::mapview(CONE_serv, zcol = "RPL_THEMES", layer.name = c("Orig"))A work by Cone Health Enterprise Analytics
Prepared by: P. Walker
Contact: philip.walker@conehealth.com